﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using AspNetCs.Model;
using AspNetCs.Bll;
using System.Data;
using System.Collections;
using AspNetCs.Enumerations;
using AspNetCs.Enumerations.memorial_enum;
using AspNetCs.Enumerations.User_Enum;
using AspNetCs.Common;
using AspNetCs.Enumerations.Channel_Enum;

public partial class Users_HistoryArticle : BasePage
{
    protected string types = "";
    protected string channelId = "";
    protected string photoClass = "";

    protected string topPhotoPath = "";

    private NetMuBLL bll = new NetMuBLL();
    protected void Page_Load(object sender, EventArgs e)
    {
        //CheckUserExit("Login.Aspx?ReUrl=" + configInfo.InstallDir + "Users/HistoryArticle.aspx", "请您登录", true);
        if (!IsPostBack)
        {
            types = Request["types"];
            channelId = Request["channelId"];
            photoClass = Request["photoClass"];
            if ((!string.IsNullOrEmpty(types)) && (!string.IsNullOrEmpty(channelId)) && (!string.IsNullOrEmpty(photoClass)))
            {
                ViewState["types"] = types;
                ViewState["channelId"] = channelId;
                ViewState["photoClass"] = photoClass;
                if (StringHelper.isNumber_int(photoClass) == 1)
                {
                    topPhotoPath = configInfo.InstallDir + "Images/historyarticle.jpg";
                }
                else if (StringHelper.isNumber_int(photoClass) == 2)
                {
                    topPhotoPath = configInfo.InstallDir + "Images/historyarticle2.jpg";
                }



            }
            else
            {
                ResultStr("Login.aspx", "参数错误");
            }

            dataBind();
        }
        else
        {
            if (ViewState["types"] != null && ViewState["channelId"] != null && ViewState["photoClass"] != null)
            {
                types = ViewState["types"].ToString();
                channelId = ViewState["channelId"].ToString();
                photoClass = ViewState["photoClass"].ToString();

            }
        }

    }

    protected void dataBind()
    {
        string cmdText = "select * from Article where IsDel=0 and ClassID=" + StringHelper.isNumber_int(photoClass) + " and ChannelType=" + StringHelper.isNumber_int(types) + " and ChannelTypeID=" + StringHelper.isNumber_int(channelId) + " order by ArticleID desc";
        AspNetCs.Common.DataPagesOperate operate = new DataPagesOperate();

        operate.BindRepeater(cmdText, AspNetPager1, "ArticleID desc", "ArticleID", rptNetMus);


    }

    protected void AspNetPager1_PageChanged(object sender, EventArgs e)
    {
        dataBind();
    }

}
